<template>
  <div>
    <div class="commons_top">
      <div class="commons_back" @click="$router.go(-1)">
        <img src="@/assets/index/back.png" />
      </div>
      <span class="commons_title">通知详情</span>
    </div>
    <div class="mess_details">
      <div class="mess_top">
        <div class="mess_top_name">{{pageData.name}}</div>
        <div class="mess_top_box">
          <span class="top_send">发信人：管理员</span>
          <span class="top_date" v-if="pageData.sendTime">{{pageData.sendTime.substring(0,16)}}</span>
        </div>
      </div>
      <div class="mess_bot" v-html="pageData.content"></div>
    </div>
  </div>
</template>

<script>
import '@static/css/common.css'
import { Toast } from 'mint-ui'
import { getDetailsAPI } from '@/api/message'

export default {
  data() {
    return {
      pageData:{}
    }
  },
  mounted() {
    this.getDetails()
  },
  methods: {
    getDetails() {
      getDetailsAPI(this.$route.query.id).then(res => {
        res.data.code === 0 ? this.pageData = res.data.data : Toast(res.data.msg)
      })
    }
  },
}
</script>

<style scoped>
.mess_details {
  width: 100%;
  height: 100vh;
  padding: 0.46rem 0.3rem 0;
  box-sizing: border-box;
}
.mess_top {
  padding-bottom: 0.37rem;
  box-sizing: border-box;
  border-bottom: 0.02rem solid #EEEEEE;
  margin-bottom: 0.47rem;
}
.mess_top_name {
  color: #333333;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 0.36rem;
}
.mess_top_box {
  overflow: hidden;
}
.mess_top_box .top_send {
  color: #BDC1CB;
  font-size: 12px;
  font-weight: 500;
}
.mess_top_box .top_date {
  float: right;
  color: #BDC1CB;
  font-size: 10px;
}
.mess_bot {
  color: #878B93;
  font-size: 14px;
  font-weight: 500;
}
.mess_bot p {
  line-height: 0.48rem;
}
</style>